﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ongoal.Quotation.Model
{
    /// <summary>
    /// 分页实体类
    /// </summary>
    public class SectionModel
    {
        /// <summary>
        /// 数据记录总条数
        /// </summary>
        public int Count { get; set; } = 0;

        /// <summary>
        /// 分页大小
        /// </summary>
        public int Size { get; set; } = 30;


        /// <summary>
        /// 页码
        /// </summary>
        public int Index { get; set; } = 1;

        /// <summary>
        /// 数据列表
        /// </summary>
        public List<dynamic>? Items { get; set; } 

    }

    /// <summary>
    /// 分页返回实体类
    /// </summary>
    public class PaginationModel: PaginationModel<dynamic>
    {
    }

    /// <summary>
    /// 分页返回实体类(泛型)
    /// </summary>
    public class PaginationModel<T>
    {
        /// <summary>
        /// 数据记录总条数
        /// </summary>
        public int Total
        {
            get;
            set;
        }

        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize
        {
            get;
            set;
        }


        /// <summary>
        /// 页码
        /// </summary>
        public int PageIndex
        {
            get;
            set;
        }

        /// <summary>
        /// 数据列表
        /// </summary>
        public List<T>? Data
        {
            get;
            set;
        }
    }

    /// <summary>
    /// 查询分页实体类(泛型)
    /// </summary>
    public class QueryPaginationModel<T>
    {

        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize
        {
            get;
            set;
        }


        /// <summary>
        /// 页码
        /// </summary>
        public int PageIndex
        {
            get;
            set;
        }

        /// <summary>
        /// 数据列表
        /// </summary>
        public T? Data
        {
            get;
            set;
        }
    }

    /// <summary>
    /// 查询分页实体类
    /// </summary>
    public class QueryPaginationModel: QueryPaginationModel<dynamic>
    {
    }
}
